Fix deprecation warnings
authorDavid Davidović <geosoft.corp@gmail.com>
Wed, 24 Dec 2014 04:51:39 +0000 (05:51 +0100)
committerDavid Davidović <geosoft.corp@gmail.com>
Wed, 24 Dec 2014 04:51:39 +0000 (05:51 +0100)
Apparently .repeat() for str and .into_string() have been deprecated,
replace them with suggested alternatives

src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/util/process_builder.rs
src/cargo/util/profile.rs

index edcd30dd9b7150b12e9234f788e8df2a3982a477..cbab1df03e20bdca0cdddd223639af0859ed2fc8 100644 (file)
@@ -92,7 +92,7 @@ pub fn prepare_target(cx: &mut Context, pkg: &Package, target: &Target,
             }
 
             if target.get_profile().is_test() {
-                cx.compilation.tests.push((target.get_name().into_string(), dst));
+                cx.compilation.tests.push((target.get_name().to_string(), dst));
             } else if target.is_bin() {
                 cx.compilation.binaries.push(dst);
             } else if target.is_lib() {
index c190ec522bad57cbbbf8447d8136a47cecc5c3a7..d1d7299418e1f777acf2862b8b6bd2b744dd5c36 100644 (file)
@@ -109,7 +109,7 @@ impl ProcessBuilder {
 
     fn debug_string(&self) -> String {
         let program = String::from_utf8_lossy(self.program.as_bytes_no_nul());
-        let mut program = program.into_string();
+        let mut program = program.to_string();
         for arg in self.args.iter() {
             program.push(' ');
             let s = String::from_utf8_lossy(arg.as_bytes_no_nul());
index c82c07cf3143762c1fc4a15a33eaf289ff223f63..e1c7ee2784a2e427874f550a970ca4577ebf6f52 100644 (file)
@@ -38,8 +38,13 @@ impl Drop for Profiler {
                 let mut last = 0;
                 for (i, &(l, time, ref msg)) in msgs.iter().enumerate() {
                     if l != lvl { continue }
-                    println!("{} {:6}ms - {}", "    ".repeat(lvl + 1),
-                             time / 1000000, msg);
+
+                    let mut spaces = String::new();
+                    for _ in range(0u, lvl + 1) {
+                        spaces.push_str("    ");
+                    }
+
+                    println!("{} {:6}ms - {}", spaces, time / 1000000, msg);
 
                     print(lvl + 1, msgs.slice(last, i));
                     last = i;